/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package nominalitzacions.ui;

import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import nominalitzacions.domain.LanguageDomainController;

/**
 *
 * @author dani.camacho.rodriguez
 */
public class VerbDictionaryViewController {
    
    private AddVerbDicView AVDV;
    private RemoveVerbDicView RVDV;
    
    private LanguageDomainController LDC;
    
    public VerbDictionaryViewController(){
        AVDV = new AddVerbDicView(this);
        RVDV = new RemoveVerbDicView(this);
        try {
            LDC = new LanguageDomainController();
        } catch (IOException ex) {
            
        }
    }
    
    public void setVisibleAdd(boolean b){
        AVDV.setVisible(b);
    }
    
    public void setVisibleRemove(boolean b){
        RVDV.setVisible(b);
    }
    
    public void add(String verb) throws IOException{
        LDC.saveVerb(verb);
        AVDV.setVisible(false);
        //System.out.println("Verb a Afegir : "+verb);
    }
    
    public void remove(String verb) throws IOException{
        LDC.deleteVerb(verb);
        RVDV.setVisible(false);
        //System.out.println("Verb a Eliminar : "+verb);
    }
    
}
